interface Girl9 {
  name: string;
  age: number;
  bust: number;
  waistline?: number;
  [propname: string]: any;
  say(): string;
}

class Xjj9 implements Girl9 {
  name = "liuyan";
  age = 22;
  bust = 90;
  say() {
    return "welcome t2";
  }
}

interface Teacher9 extends Girl9 {
  teach(): string;
}
// 与type 区别
// type Girl1 = number;

const girl = {
  name: "dajiao",
  age: 22,
  bust: 90,
  waistline: 22,
  sex: "female",
  say() {
    return "welcome ss";
  },
  teach() {
    return 'teach fn'
  }
};

const screenResume = (girl: Girl9) => {
  const { name, age, bust } = girl;
  age <= 24 && bust >= 90 && console.log(name + " in");
  (age > 24 || bust < 90) && console.log(name + " out");
};

const getResume = (girl: Teacher9) => {
  const { name, age, bust } = girl;
  console.log(name + " age is " + age);
  console.log(name + " bust is " + bust);
  girl.waistline && console.log(girl.waistline);
  girl.sex && console.log(girl.sex);
  console.log(girl.say());
  console.log(girl.teach());
};

screenResume(girl);
getResume(girl);
